<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

</body>
<script>


//工厂模式 
   function car(sHege,sJianyi){
         var xcar=new Object();
             xcar.hege=sHege;
             xcar.jianyi=sJianyi;
             xcar.say=function(){
                document.write("品牌："+xcar.hege+"<br/>"+"零售价："+xcar.jianyi+"<br/>"+"说明：时尚时尚最时尚"+"<br/>")
         }
            return xcar;
     }
     var xcar1=car("大众","19-23");
     xcar1.say();



//构造函数
    function Person(sName,sSex,iAge,yYou,hHua){
            this.name=sName;
            this.sex=sSex;
            this.age=iAge;
            this.you=yYou;
            this.hua=hHua;
            this.say=function(){
                document.write("我叫"+this.name+"<br/>"+"性别："+this.sex+"<br/>"+"今年"+this.age+"<br/>"+"我有"+this.you+"<br/>"+this.you+"会说话"+"<br/>"+"他说："+this.hua);
    	}
    }
    var person1=new Person('小明','男',18,"男朋友","我为什么找了你这么个男朋友啊！");
    person1.say()





</script>
</html>